package myJs.cps.myTable

import japgolly.scalajs.react._
import japgolly.scalajs.react.vdom.all._
import myJs.cps._

import scala.collection.immutable.SeqMap
import cats.effect._
import japgolly.scalajs.react.util.EffectCatsEffect._

/** Created by yz on 15/9/2023
  */
object CheckboxSearchLiCp {

  case class Props(
      values: List[String],
      valuesChange: List[String] => SyncIO[Unit],
      optionMap: SeqMap[String, String]
  ) {
    @inline def render: VdomElement = {
      Component(this)
    }
  }

  val Component = ScalaFnComponent[Props] { props =>
    object FTool {}
    li(
      className := "myLi myInputLi dateInput",
      div(
        marginBottom := 10.px,
        span(className := "fa fa-filter"),
        s" Screening"
      ),
      div(
        marginBottom := 10.px,
        className := "form-group",
        div(
          className := "col-sm-12",
          PureSelect2MulCp
            .Props(
              width = "100%",
              optionMap = props.optionMap,
              value = props.values,
              onChange = props.valuesChange
            )
            .render
        )
      )
    )

  }

}
